#coding:utf8

from libjade import *
from scripts import *

def build():
	for d in 'build bin lib'.split():
		if not exists(d): md(d)
	if os.name=='nt':
		# cmd='cd build & call msvc & cmake .. & for %i in (*.sln) do msbuild %i'
		cmd='cd build & cmake .. -G "MinGW Makefiles" & make'
		# cmd='cd build & call msvc & cmake .. -G "NMake Makefiles" & nmake'
	else:
		cmd='cd build ; cmake .. ; make'
	run_cmd(cmd)
	
def clean():
	for d in 'build bin lib'.split():
		rm(d)

def gen_cmake():
	gen_cmake_recursively(join(cwd(), 'tests'), '../include')

# clean()
gen_cmake()
build()



